﻿using System;
using System.Collections.Generic;
using System.Text;

namespace T.FAS.Runtime.DataAccess.SPI
{
    /// <summary>
    /// 通用模型节点
    /// </summary>
    [Serializable]
    public class CommonModelNode
    {
        /// <summary>
        /// 标识
        /// </summary>        
        public string ID { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 是否为根结点
        /// </summary>
        public bool IsRootNode { get; set; }

        /// <summary>
        /// 是否只读
        /// </summary>
        public bool IsReadOnly { get; set; }

        /// <summary>
        /// 隶属的通用中间对象
        /// </summary>
        public CommonModel CommonObject { get; set; }

        /// <summary>
        /// 父节点对象
        /// </summary>        
        public CommonModelNode ParentNode { get; set; }

        /// <summary>
        /// 节点类型
        /// </summary>
        public CommonModelNodeType CommonModelNodeType { get; set; }

        private List<CommonModelNode> childNodeObjects;
        /// <summary>
        /// 子节点对象集合
        /// </summary>        
        public virtual List<CommonModelNode> ChildNodeObjects
        {
            get
            {
                return childNodeObjects;
            }
            set
            {
                childNodeObjects = value;                
            }
        }

        /// <summary>
        /// 隶属的通用中间对象ID
        /// </summary>
        public string CommonObjectID
        {
            get
            {
                return CommonObject.ID;
            }
        }
    }
}
